<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>文档管理</title>
    <link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/xadmin.css">
    <script type="text/javascript" charset="utf-8" src="/static/js/jquery-1.11.3.min.js"></script>
    <script src="/static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="/admin/welcomepage">首页</a>
        <a href="javascript:window.location.reload();">
          <cite>文档管理</cite>
        </a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <blockquote class="layui-elem-quote">此处修改和添加系统API文档,修改/添加后可在开发文档也查看!</blockquote>
    <xblock>
        <button class="layui-btn" onclick="x_admin_show('添加文档','/admin/doc/add')"><i class="layui-icon"></i>添加
        </button>
        <span class="x-right" style="line-height:40px">共有数据：${bean.totalNum!0} 条</span>
    </xblock>
    <div id="dewdewfef">
        <%#ajax pagenode:{%>
        <table class="layui-table">
            <thead>
            <tr>
                <th>编号</th>
                <th>标题</th>
                <th>创建时间</th>
                <th>是否显示</th>
                <th>排序</th>
                <th>操作</th>
            </thead>
            <tbody>
            <%for(o in bean.items!){%>
            <tr>
                <td>${o.id!}</td>
                <td>${o.title!}</td>
                <td>${o.createTime!,dateFormat='yyyy-MM-dd HH:mm:ss'}</td>
                <td>
                    <%if(o.status! ==1){%>显示<%}else if(o.status! ==2){%>不显示<%}else{%>QQ<%}%>
                </td>
                <td>${o.orderBy!}</td>
                <td class="td-manage">
                    <a title="编辑" onclick="x_admin_show('编辑','/admin/doc/edit?id=${o.id!}')" href="javascript:void(0);">
                        <i class="layui-icon">&#xe63c;</i>
                    </a>&nbsp;&nbsp;&nbsp;
                    <a title="删除" onclick="member_del(this,'${o.id!}')" href="javascript:void(0);">
                        <i class="layui-icon">&#xe640;</i>
                    </a>
                </td>
            </tr>
            <%}%>
            </tbody>
        </table>
        <div class="page">
            <%include("/include/page.html",{context:'dewdewfef',action:'/admin/doc/list',model:bean!}){}%>
        </div>
        <script>
            $(function () {
                layui.use('laydate', function () {
                    var laydate = layui.laydate;
                    //执行一个laydate实例
                    laydate.render({
                        elem: '#start' //指定元素
                    });
                    //执行一个laydate实例
                    laydate.render({
                        elem: '#end' //指定元素
                    });
                });
            });

            function member_del(obj, id) {
                layer.confirm('确认要删除吗？', function (index) {
                    $.post("/admin/doc/delete",
                        {"id":id},
                        function (data) {
                            layer.msg(data.msg, {icon: 1, time: 800});
                            $(obj).parents("tr").remove();
                            window.location.reload();
                        },"json");
                });
            }
        </script>
        <%}%>
    </div>



</div>
</body>
<script>
    layui.use(['form', 'layer'], function () {
        $ = layui.jquery;
    });
</script>
</html>